package com.stox.client.embedded.charting;

import java.util.List;

import com.stox.client.api.charting.ChartingClient;
import com.stox.services.charting.manager.ChartingManager;
import com.stox.shared.charting.model.ChartGroup;
import com.stox.shared.charting.model.SavedChart;

public class EmbeddedChartingClient implements ChartingClient {
	
	public static final EmbeddedChartingClient INSTANCE = new EmbeddedChartingClient();
	
	private EmbeddedChartingClient() {
		
	}

	@Override
	public void save(SavedChart chart) {
		ChartingManager.INSTANCE.save(chart);
	}

	@Override
	public void save(ChartGroup chartGroup) {
		ChartingManager.INSTANCE.save(chartGroup);
	}
	
	@Override
	public void deleteChartGroup(Long chartGroupId) {
		ChartingManager.INSTANCE.deleteChartGroup(chartGroupId);
	}
	
	@Override
	public void deleteSavedChart(Long savedChartId) {
		ChartingManager.INSTANCE.deleteSavedChart(savedChartId);
	}

	@Override
	public List<ChartGroup> findAllChartGroups() {
		return ChartingManager.INSTANCE.findAll();
	}

	@Override
	public List<SavedChart> findByChartGroupId(Long id) {
		return ChartingManager.INSTANCE.findByChartGroupId(id);
	}

	@Override
	public String loadContent(Long chartGroupId, Long savedChartId) {
		return ChartingManager.INSTANCE.loadContent(chartGroupId, savedChartId);
	}

}
